import java.sql.*;
public class Test01 {
	private static final String DRIVER ="oracle.jdbc.driver.OracleDriver";
	private static final String URL="jdbc:oracle:thin:@Carson-AA:1521:XE";
	private static final String USERNAME="carson";
	private static final String PASSWORD="12345";
	
	public static void main(String[] args) {
		try{
			Class.forName(DRIVER);
			Connection conn = DriverManager.getConnection(URL,USERNAME,PASSWORD);
			Statement st = conn.createStatement();
			int n = st.executeUpdate("insert into Sample values('Tom',72)");
			System.out.println(n+"records are inserted.");
			ResultSet rs = st.executeQuery("select * from Sample");
				while(rs.next()){
					System.out.println(rs.getString("Name")+"\t"+rs.getInt("Age"));
				}rs.close();
		}catch(Exception e){
			e.printStackTrace();
		}
	}
}
